<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2023-01-10 11:17:49
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-01-10 11:30:31
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="refresh" content="1">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #clock{
            width: 400px;
            height: 50px;
            background-color: black;
            color: white;
            float:right;
            text-align: center;
            line-height: 50px;
            font-size: 20px;
            margin-top: 50px;
        }
    </style>
</head>
<body>
    <div id="clock">
        
    </div>
    <script>
        // var time = new Date(1673319924000);
        // console.log(time); // 日期对象
        // console.log(time.getFullYear()); // 2023
        // console.log(time.getMonth()); // 0 1月 
        // console.log(time.getDate());// 10 日期
        // console.log(time.getDay());// 2 周二 
        // console.log(time.getHours()); // 11 
        // console.log(time.getMinutes()); // 5
        // console.log(time.getSeconds());// 24
        // console.log(time.getMilliseconds()); // 0
        // console.log(time.getTime()); // 1673319924000

        var time = new Date();
        var year = time.getFullYear();
        var month = time.getMonth();
        var date = time.getDate();
        var day = time.getDay();
        var hour = time.getHours();
        var minutes = time.getMinutes();
        var seconds = time.getSeconds();
        
        hour = (hour<10)?'0'+hour:hour;
        minutes = (minutes<10)?'0'+minutes:minutes;
        secondes = (seconds<10)?'0'+seconds:seconds;

        document.getElementById("clock").innerHTML = `${year}年${month+1}月${date}日 ${hour}时${minutes}分${seconds}秒周${day}`
    </script>
</body>
</html>